package com.woniuxy01;

import java.util.Arrays;
import java.util.Random;

/**
 * @author 作者
 * @create 2025-07-28 15:33
 */
public class Test06 {
    public static void main(String[] args) {
        //获取当前日期时间的毫秒数,从1970-1-1 0:0:0开始到当前时间经过了多少毫秒
        System.out.println(System.currentTimeMillis());
//        System.out.println("aaa");
////        System.exit(0);
//        if (true) {
//            return ;
//        }
//        System.out.println("bbb");
    }

    private static void test06() {
        int[] a={56,12,25,34,44,45};
        //二分查找：
        System.out.println(Arrays.binarySearch(a, 12));
        System.out.println(Arrays.binarySearch(a, 34));
        System.out.println(Arrays.binarySearch(a, 56));
        System.out.println(Arrays.binarySearch(a, 156));
    }

    private static void test05() {
        int[] a={1,2,3,4,5};
        int[] b=new int[10];
        System.arraycopy(a,1,b,3,3);
        System.out.println(Arrays.toString(b));
    }

    private static void test04() {
        int[] a={1,2,3,4,5};
        System.out.println(Arrays.toString(a));
        //数组扩容
        a = Arrays.copyOf(a, 10);
        System.out.println(Arrays.toString(a));
    }

    private static void test03() {
        Random random = new Random();
        for (int i = 0; i < 10; i++) {
//            System.out.println(random.nextDouble());
            System.out.println(random.nextInt(0, 100));
        }
    }

    private static void test02() {
        System.out.println(Math.random());
        System.out.println(Math.abs(-1));
        System.out.println(Math.pow(2,3));
        System.out.println(Math.max(3, 5));
        //向下取整:小于这个的数的最大整数
        System.out.println(Math.floor(3.5));
        //向上取整:大于这个的数的最小整数
        System.out.println(Math.ceil(3.5));
    }

    private static void test01() {
        Character c='a';
        System.out.println(c.charValue());
        System.out.println(c);

        System.out.println(Character.isDigit(c));
        System.out.println(Character.isUpperCase(c));
        System.out.println(Character.isLowerCase(c));
    }
}
